import { fliterPermission } from '@/utils/sys.js'
export const apis = {
list: `/business/basis/getList?modelCode=MODEL_COMMISSION&authCode=FUNCTION_COMMISSION_LIST`,
  detail: `business/basis/detail?modelCode=MODEL_COMMISSION&authCode=BTN_COMMISSION_DETAIL`,
 getUserList: `/business/user/getUserList?authCode=FUNCTION_ORDER_LIST`,
};

export const configs = {
  listUrl: apis.list,
  pageOn: true, // 开启分页
  searchOn: true, // 开启搜索
  operateOn: true, //开启操作区域
  treeOn: false, // 开启树形
};


export const searchs = [

  {
    type: "SelectModel",
    column: "user_id",
    label: "用户",
    url:apis.getUserList,
    mapping : {
      label:['user_nick'],
      value: 'id'
    },
    
   
  },
  {
    type: "SelectModel",
    column: "user_id",
    label: "用户编号",
    url:apis.getUserList,
    mapping : {
      label:['id','user_nick'],
      value: 'id'
    }
  },
  {
    type: "SelectModel",
    column: "manage_id",
    label: "代理",
    modelCode: "MODEL_BUSINESS_MANAGE",
    mapping : {
      label:['manage_account'],
      value: 'id'
    }
  },

  {
    type: "Input",
    column: "transfer_no",
    label: "转运单号",
  },
  
  {
    type: "DatePicker",
    column: "ctime",
    label: "创建时间",
  },
];

export const pages = {
  pageSize: 20,
  orders: [
    {
      field: "id",
      sort: "desc",
    },
  ],
 
};
export const columns = [
  { type: "selection" },
  // {
  //   label: "ID",
  //   column: "id",
  //   sortable: "custom",
    
  // },

  {
    label: "转运订单号",
    column: "transfer_no",
    display: "text",
  },

  
  {
    label: "用户",
    column: "user_id",
    display: "detail",
    format:'model',
    config: {
      mode:'custom', //'default', 默认，custom自定义方式
      component: 'user/components/Mode',
    }
  },
  {
    label: "代理",
    column: "manage_id",
    display: "detail",
    format:'model',
    config: {
      mode:'custom', //'default', 默认，custom自定义方式
      component: 'manage/components/Mode',
    }
  },
  {
    label: "提成金额（元）",
    column: "commission_price",

  },
 
  {
    label: "创建时间",
    column: "ctime",
    format: "datetime",
    display: "text",
  },

  // { label: "操作", column: "operate", width: "240", fixed: "right" },
];

export const buttons = fliterPermission([


]);
export const columnButtons = fliterPermission([
  // {
  //   operate: "detail",
  //   text: "详情",
  //   permission: 'BTN_ORDER_DETAIL',
  // },

 
]);
